﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Zeus.Classes
{
    public class ImageProperties 
    {
        public void Name(Image I, TextBox TB)
        {
            I.Name = TB.Text;
        }

        public void Opacity(Image I, TextBox TB)
        {
            double x = double.Parse(TB.Text);
            if ((x >= 0) && (x <= 100))
                I.Opacity = x;
        }

        public void Visible(Image I, ComboBox CB)
        {
            if (CB.SelectedItem.ToString() == "Visible")
                I.Visibility = Visibility.Visible;
            else
                I.Visibility = Visibility.Collapsed;
        }

        public void Size(Image I, TextBox TB1, TextBox TB2)
        {
            I.Width = double.Parse(TB1.Text);
            I.Height = double.Parse(TB2.Text);

        }

        public void Margin(Image I, TextBox TB1, TextBox TB2, TextBox TB3, TextBox TB4)
        {
            throw new NotImplementedException();
        }

        public void stretch(Image I, ComboBox CB)
        {
            string Type;
            Type = CB.SelectedItem.ToString();
            I = new Image();
            if (Type == "Fill")
                I.Stretch = Stretch.Fill;
            if (Type == "Uniform")
                I.Stretch = Stretch.Uniform;
            if (Type == "UniformToFill")
                I.Stretch = Stretch.UniformToFill;
            if (Type == "None")
                I.Stretch = Stretch.None;

        }

    }
}
